<?php

class Application_Model_Ocupaciones extends Sgit_Model
{
    protected $_name = 'ocupaciones';
    protected $_primary = 'id';


    public function getOcupaciones($values)
    {
        
        //permite pasar unico parametro id del contador
        if(is_numeric($values)){
            $id=$values;unset($values);$values['id']=$id;unset($id);
        } 

        $select=$this->getAdapter()->select()->from(array($this->_name));
        

        if(is_numeric($values['anio']))
            $select->where("{$this->_name}.anio= ?", $values['anio'],INTEGER);

        $rows = $this->getAdapter()->fetchAll($select);
        
        
        
       
        if (is_numeric($values['id']))
            return $rows[0];
        else
            return $rows;

    }



}
